package com.mhkj.common.mq;

import javax.annotation.Resource;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mhkj.revise.plan.service.PlanNodeService;

/**
 * 处理计划响应
 * @author mics
 * @date 2018年7月11日
 * @version 1.0
 */
@Component
public class PlanReponseReciver {
	@Resource
	private PlanNodeService planNodeService;
	
    @JmsListener(destination="plans")
    public void process(String json) {
    	Gson gson = new GsonBuilder().create();
    	PlanResponse planResponse  = gson.fromJson(json, PlanResponse.class);
        System.out.println("Receiver1  : " + json);
        try{
            //planNodeService.handleState(Long.valueOf(planResponse.getData().getNodeId()),planResponse.getData().getAuditDate());
        }catch(Exception e){
        	e.printStackTrace();
        }
    }
	   
}
